import React from 'react';
import { connect } from 'dva';
import { routerRedux } from 'dva/router';
import {Icon,WhiteSpace} from 'antd-mobile';


import style from './ranklistPerson.less';



class RankListIteam extends React.Component {

  constructor(props){
    super(props);
    this.state = {

    };
  }

  render(){

    const {rank,name,org,point6,lv}=this.props;

    return (
      <div>
        <div className={style.List} onClick={this.onclick}>
          <div className={style.personList}>
            <div className={style.rankIcon}>
              {
                rank == 1 && <div className={style.icon}><Icon type={require("../../../svgs/mine/first.svg")} /></div>
              }
              {
                rank == 2 && <div className={style.icon}><Icon type={require("../../../svgs/mine/second.svg")} /></div>
              }
              {
                rank == 3 && <div className={style.icon}><Icon type={require("../../../svgs/mine/third.svg")} /></div>
              }
              {
                rank != 1 && rank != 2 && rank !=3 && <div className={style.noIcon}>{rank}</div>
              }
            </div>
            {/*<div className={style.nolistRanking}>398</div>*/}
            <div className={style.listPeople}>
              {
                rank == 1 && <div><span style={{color:'#FF2832'}}>{name}</span><br /><WhiteSpace size='sm'/></div>
              }
              {
                rank == 2 && <div><span style={{color:'#FF7D08'}}>{name}</span><br /><WhiteSpace size='sm'/></div>
              }
              {
                rank == 3 && <div><span style={{color:'#FFAC09'}}>{name}</span><br /><WhiteSpace size='sm'/></div>
              }
              {
                rank != 1 && rank != 2 && rank !=3 && <div><span>{name}</span><br /><WhiteSpace size='sm'/></div>
              }
              {/*<span className={style.listOrg}>{org.length > 16 ? `${org.substring(0, 16)}...` : org}</span>*/}
              <span className={style.listOrg}>{org}</span>
            </div>
            <div className={style.listPoints}>{point6}分|{lv}级</div>
          </div>
        </div>
      </div>
    )
  }
}

export default connect()(RankListIteam);
